import 'package:earclean/app/modules/home/views/home_view.dart';
import 'package:earclean/app/modules/message/views/message_view.dart';
import 'package:earclean/app/modules/mine/views/mine_view.dart';
import 'package:earclean/app/modules/serve/views/serve_view.dart';
import 'package:earclean/app/modules/technician/views/technician_view.dart';
import 'package:earclean/app/modules/widget/bottom_bar.dart';
import 'package:earclean/app/modules/widget/keep_alive_page.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../controllers/table_controller.dart';

class TableView extends GetView<TableController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(children: [
          Positioned.fill(
            child: PageView(
              physics: const NeverScrollableScrollPhysics(),
              // onPageChanged: controller.changePage,
              controller: controller.pageController,
              children: [
                keepAliveWrapper(HomeView()),
                keepAliveWrapper(TechnicianView()),
                keepAliveWrapper(ServeView()),
                keepAliveWrapper(MessageView()),
                keepAliveWrapper(MineView()),
              ],
            ),
          )
        ]),
        bottomNavigationBar: Obx(() => controller.showTabbar.value
            ? BottomAppBar(
                child: Obx(() => HomeBottomBar(
                    controller.currentIndex.value, controller.changePage)))
            : Container(
                height: 1,
              )));
  }
}
